﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Data;
using DevExpress.XtraReports.Parameters;

namespace ConfExpert.Forms.Rapor
{
    public partial class xrSubCekmeDegerleri : DevExpress.XtraReports.UI.XtraReport
    {
        public Parameter PrdId;
        public xrSubCekmeDegerleri()
        {
            InitializeComponent();

            PrdId = new Parameter();
            PrdId.Name = "PrdId";
            PrdId.Type = typeof(int);
            PrdId.ValueInfo = "0";
            PrdId.Visible = false;

            this.FilterString = "[ProductId] = ?PrdId";
            this.Parameters.Add(PrdId);
        }

        DataSet ds;
        DataTable dtModel;
        public void fillTable(DataTable dt)
        {
            ds = new DataSet();
            dtModel = new DataTable("dtModel");
            ds.Tables.Add(dtModel);
            dtModel.Merge(dt);

            this.DataMember = dtModel.TableName;
            this.DataSource = ds;
        }
        private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            this.DataMember = dtModel.TableName;
            this.DataSource = ds;

            tcRollId.DataBindings.Add("Text", null, "dtModel.RollId");
            tcEn.DataBindings.Add("Text", null, "dtModel.En");
            tcBoy.DataBindings.Add("Text", null, "dtModel.Boy");
            tcLot.DataBindings.Add("Text", null, "dtModel.Lot");
        }

    }
}
